<template>
	<view>
		<nav-bar   fontColor="#FFFFFF" title="轨迹"></nav-bar>
		<logistics :wlInfo="wlInfo"></logistics>
		<!-- <view class="content" v-for="(item,index) in getList" :key="item.id">
			<view>
				<view class="contentFont">创建时间：{{item.createTime}}</view>
				<view class="contentFont"> 类 型：{{item.optType}}</view>
				<view class="contentFont">备注：{{item.remark}}</view>
				<view class="contentFont">操作时间：{{item.optTime}}</view>
			</view>
			
		</view> -->
	</view>
</template>

<script>
	import logistics from '@/components/xinyu-logistics/xinyu-logistics.vue'
	export default {
		components: { logistics },
		data() {
			return {
				getListData: null,
				rfidCode: '',
				getList: [],
				wlInfo: {
				    delivery_status: 1, //快递状态 1已签收 2配送中
				    list: []
				}
			}
		},
		onLoad(e) {
			this.rfidCode = e.id
			console.log(this.rfidCode)
			this.getTrajectoryInfo();
		},
		methods: {
			onGroupChange(e) {
				console.log(e)
			},
			getTrajectoryInfo() {
				let opt = {
					url: 'oms/tbTrajectoryInfo/search',
					method: 'POST'
				};
				let param = {
					rfid: this.rfidCode
				};
				this.$http.httpTokenRequest(opt, param).then(res => {
					uni.showLoading({
						title:'加载中...'
					});
					if(res.data.code == 200){
						this.getList = res.data.data
						for(let i=0;i<this.getList.length;i++){
							this.wlInfo.list.push({
								time: this.getList[i].createTime,
								timeArr:[this.getList[i].createTime.slice(0,10),this.getList[i].createTime.slice(11,19)],
								context: this.getList[i].remark,
								optType: this.getList[i].optType
							})
						}
						console.log(this.wlInfo.list)
						uni.hideLoading();
					}
					else{
						uni.hideLoading();
						uni.showToast({
							title:'出错啦！',
							icon:'error',
							position:'center'
						});
					}
					
				})
			},
			toggleCheckbox2(index) {
				this.$refs.listCheckbox2[index].toggle()
			}
		}
	}
</script>

<style>
	page {
		background: #f8f8f8;
	}

	.content {
		padding: 20rpx;
		letter-spacing: 2rpx;
		font-size: 35rpx;
		color: #646464;
		border-bottom: 1px solid #e2e2e2;
		display: flex;
	}

	.checkBox {

		/* width: 50rpx; */
		/* position: absolute;
		right: 0rpx; */
		align-self: center;
	}

	.contentFont {
		padding: 5rpx;
	}

	.buttonBox {
		position: fixed;
		width: 100%;
		bottom: 10rpx;
		left: 0;
	}

	.primaryButton {
		margin: 0 auto;
		background: #007AFF;
		width: 95%;
		height: 80rpx;
		text-align: center;
		font-size: 38rpx;
		font-weight: 900;
		color: #FFFFFF;
		line-height: 80rpx;
		border-radius: 15rpx;
	}
</style>
